var app = getApp();

Page({
    data: {
        list: []
    },
    jumpred:function(t){
        var e = t.currentTarget.dataset.yhqid, a = t.currentTarget.dataset.sjid, o = t.currentTarget.dataset.qid,ty = t.currentTarget.dataset.type;
        if('km'==ty){
            console.log(t, e, a, o), wx.navigateTo({
                url: "../sellerinfo/yhqinfo?yhqid=" + e + "&type=" + ty
            });
        }else if('jc'==ty){
                console.log(t, e, a, o,ty), wx.navigateTo({
                    url: "../sellerinfo/yhqinfo?yhqid=" + e + "&sjid=" + a + "&qid=" + o + "&type=" + ty
                });
           
        }else{
            console.log(t, e, a, o), wx.navigateTo({
                url: "../sellerinfo/yhqinfo?yhqid=" + e + "&sjid=" + a + "&qid=" + o
            });
        }
    },
    onLoad: function(t) {
        var n = this;
            console.log('领取了',t)
            
                app.util.request({
                    url: "entry/wxapp/RedBagIndex",
                    cachetime: "0",
                    data: {
                        uid: t.uid,
                        code: t.code
                    },
                    success: function(o) {
                        if(o.data  == '-1'){
                            wx.showModal({
                                title: "此红包已被使用",
                                content: "",
                                success: function(e) {
                                    wx.navigateTo({
                                        url: "../wdq/wdq"
                                        
                                    });
                                }
                            }) 
                        }else{
                            n.setData({
                                list: o.data
                            })
                        } 
                    }
                });
            
         
        
        
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {}
});